bitkeeper revision 1.1430 (4289ef91cnLSZ2abQmRijAYRLrwMjQ)
authormaf46@burn.cl.cam.ac.uk <maf46@burn.cl.cam.ac.uk>
Tue, 17 May 2005 13:20:17 +0000 (13:20 +0000)
committermaf46@burn.cl.cam.ac.uk <maf46@burn.cl.cam.ac.uk>
Tue, 17 May 2005 13:20:17 +0000 (13:20 +0000)
Bug fix for shadow external mode (i.e. VMX) operation,
fixing an overly aggressive new ASSERT added with the light weight
shadow code.

xen/arch/x86/domain.c
xen/arch/x86/shadow.c

index 34c79ce68ab2abc64cecb6193b7100c24924fe44..e99f4f4743d6779618588ad5eaeb3b482f53054b 100644 (file)
@@ -364,7 +364,8 @@ static int vmx_final_setup_guest(
         /* Put the domain in shadow mode even though we're going to be using
          * the shared 1:1 page table initially. It shouldn't hurt */
         shadow_mode_enable(ed->domain,
-                           SHM_enable|SHM_refcounts|SHM_translate|SHM_external);
+                           SHM_enable|SHM_write_all|SHM_refcounts|
+                           SHM_translate|SHM_external);
     }
 
     return 0;
index b94e763f51949549c2594d672ac61de59876efc8..05a34bf82016cb9442afb0446dc85ec2ed84ee4a 100644 (file)
@@ -2307,9 +2307,10 @@ static int resync_all(struct domain *d, u32 stype)
             // guest page.
             // This only applies when we have writable page tables.
             //
-            if ( (stype == PGT_l1_shadow) && !VM_ASSIST(d, VMASST_TYPE_writable_pagetables) )
-                continue;
-            if ( (stype != PGT_l1_shadow) && !shadow_mode_write_all(d) )
+            if ( !shadow_mode_write_all(d) &&
+                 !((stype == PGT_l1_shadow) &&
+                   VM_ASSIST(d, VMASST_TYPE_writable_pagetables)) )
+                // Page is not writable -- no resync necessary
                 continue;
         }
 
@@ -2336,7 +2337,8 @@ static int resync_all(struct domain *d, u32 stype)
             l1_pgentry_t *shadow1 = shadow;
             l1_pgentry_t *snapshot1 = snapshot;
 
-            ASSERT(VM_ASSIST(d, VMASST_TYPE_writable_pagetables));
+            ASSERT(VM_ASSIST(d, VMASST_TYPE_writable_pagetables) ||
+                   shadow_mode_write_all(d));
 
             if ( !shadow_mode_refcounts(d) )
                 revalidate_l1(d, guest1, snapshot1);